package com.taysear.parcel.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Route implements Serializable{

	@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="route_start")
	private Substation routeStart;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="route_end")
	private Substation routeEnd;
	@Temporal(TemporalType.DATE) @Column(name="date_created") 
	private Date dateCreated;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="route_status")
	private RouteStatus routeStatus ;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Substation getRouteStart() {
		return routeStart;
	}
	public void setRouteStart(Substation routeStart) {
		this.routeStart = routeStart;
	}
	public Substation getRouteEnd() {
		return routeEnd;
	}
	public void setRouteEnd(Substation routeEnd) {
		this.routeEnd = routeEnd;
	}
	public Date getDateCreated() {
		return dateCreated;
	}
	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}
	public RouteStatus getRouteStatus() {
		return routeStatus;
	}
	public void setRouteStatus(RouteStatus routeStatus) {
		this.routeStatus = routeStatus;
	}
	@Override
	public String toString() {
		return id.toString();
	}
	
}
